package com.ld.oauth.controller;

import com.ld.common.ResultInfoFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;
import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/product")
public class ProductController {

    @RequestMapping("/list")
    //@PreAuthorize("hasAuthority('product:list')")
    public ResultInfoFactory list(Principal principal){
        List<String> list = new ArrayList<>();
        list.add("aa");
        list.add("bb");
        list.add("cc");
        list.add(principal.getName());
        return ResultInfoFactory.success(list);
    }



}
